package world.criver.imagecompresstool.function;

import world.criver.imagecompresstool.data.daValue;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;

public class funCache {

    public void add(String[] as){
        String qw = "";
        for (String i : as) qw += i + "\n";
        if(qw.length()<8)return;
        File f = new File(daValue.bin_url+"/cache");
        if (!f.exists() || f.isFile()) f.mkdirs();
        try (BufferedWriter wr = new BufferedWriter(new FileWriter(daValue.bin_url+"/cache/" + System.nanoTime()))) {
            wr.write(qw);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
}
